﻿@model IEnumerable<DHQGHN.PM2.Models.EnumeratorModel>
@{
    ViewBag.Title = "Quản lý cán bộ nghiệp vụ";
    ViewBag.Root = "Quản lý chung";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}
<link href="~/Content/index.css" rel="stylesheet" />
<script src="@Url.Content("~/Scripts/paging.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/enumeratorsearch.js")" type="text/javascript"></script>

<script>
    @functions{
         public string GetAntiForgeryToken()
         {
             string cookieToken, formToken;
             AntiForgery.GetTokens(null, out cookieToken, out formToken);
             return cookieToken + "," + formToken;
         }
     }

    var headers = {};
    var urlPrintExcel = '@Url.Action("ExportData")';
    var urlPrintEnum = '@Url.Action("print")';
    
    window.onload = function () {
        headers['VerificationToken'] = '@GetAntiForgeryToken()';
        $("#FULL_NAME").focus();
        urlPrintExcel = '@Url.Action("ExportData")';       
    }
</script>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
}

@Html.Hidden("ADMIN_CODE", ((string)(ViewBag.ADMIN_CODE)))

<div class="page-bar">
    <ul class="page-breadcrumb" style="padding: 4px;">
        <li>
            <i class="fa fa-home"></i>
            <a href="#"> Quản lý cán bộ nghiệp vụ</a>
        </li>
    </ul>
</div>

<div class="row">
    <div class="col-md-2 col-sm-2" style="">@Html.Label("Họ và tên: ", new { id = "lblName", @class = "" })</div>
    <div class="col-md-4 col-sm-4" style="margin-bottom: 10px;">@Html.TextBox("FULL_NAME_SEARCH", "", new { @class = "form-control input-sm", style = "", placeholder = "Họ và tên", maxlength = 255 })</div>

    <div class="col-md-2 col-sm-2" style="">@Html.Label("Tên đăng nhập: ")</div>
    <div class="col-md-4 col-sm-4" style="margin-bottom: 10px;">@Html.TextBox("USERNAME_SEARCH", "", new { @class = "form-control input-sm", style = "", placeholder = "Tên đăng nhập", maxlength = 50 })</div>

    <div class="col-md-2 col-sm-2" style="">@Html.Label("Chọn nhóm: ")</div>
    <div class="col-md-4 col-sm-4" style="margin-bottom: 10px;">@Html.DropDownList("GROUPCODE_SEARCH", ViewBag.Groups as List<SelectListItem>, new { @class = "form-control input-sm" })</div>

    <div class="col-md-6 col-sm-6">
        <div class="pull-right">
            <button id="btnSearch" class="btn btn-sm btn-default"><i class="fa fa-search"></i> Tìm kiếm</button>
            <a class="btn btn-sm btn-default" onclick="onCreate()" style="cursor:pointer;"><i class="fa fa-plus-square-o"></i> Tạo mới</a>
            <button id="inExcel" class="btn btn-sm btn-default"><i class="fa fa-file-excel-o"></i> Xuất Excel</button>
            <button id="btnPrint" class="btn btn-sm btn-default"><i class="fa fa-print"></i> In</button>
            <div id="divPrintEnum" style="display:none;"></div>
</div>
    </div>
</div>

<div id="gridContent" align="center" style="padding:10px;">
    @if (Model != null && Model.Count<DHQGHN.PM2.Models.EnumeratorModel>() > 0)
    {
        @Html.Partial("GridViewDetailPartial", Model)
    }
    else
    {
        <h4>Không tìm thấy kết quả nào phù hợp</h4>
    }
</div>
<div id="pagingContainer2" style="border:1px solid blue; height: 55px; width: auto; display: none; ">
</div>
<br/>